package com.pn.mapper;

import com.github.pagehelper.Page;
import com.pn.entity.Brand;
import com.pn.entity.Unit;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UnitMapper {

    //显示品牌列表
    Page<Unit> unitPageList(Unit unit);

    //修改品牌
    int unitUpdate(Unit unit);

    //添加品牌
    @Insert("insert into unit values (null,#{unitName},#{unitDesc})")
    int unitInsert(Unit unit);

    //删除品牌
    @Delete("delete from unit where unit_id = #{unitId}")
    int unitDelete(Integer unitId);

    //显示品牌表
    @Select("select * from unit")
    List<Unit> unitList();
}
